<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>迭代器模式</title>
	</head>
	<body>
		<script>
			// 编写一个迭代器生成函数
			function *iteratorGenerator() {
			    yield '1号选手'
			    yield '2号选手'
			    yield '3号选手'
			}
			
			const iterator = iteratorGenerator()
			
			iterator.next()
			iterator.next()
			iterator.next()
		</script>
	</body>
</html>
